-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat(chain): add EIP-7702 set-code transactions for EOAs #13408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…setext to ATX and fix nesting
…, EthTx.authorizationList, and dispatch (Phase-1)
…rd checks in test plan
…ENTS with scaffolding and next steps
… ToUnsignedFilecoinMessage; adjust delegator types to avoid cycles; update AGENTS.md
…ons; actor: add no-op ApplyDelegations stub; update AGENTS.md
… expand AGENTS with state + scaffolding pointers
…dFilecoinMessage; delegator: add ApplyDelegationsParams; update AGENTS
… feature enabled and delegator-targeted; update docs
…stment wiring; list new scaffolding files
…ainId set) with tests; update AGENTS
…e ToEthTx carries authorizationList; update AGENTS
…ests; docs: update AGENTS tests list
…s; tests for writes and mismatched nonce; clarify actor stub
…d mapping/nonce tests
… validation commands and test guidance
…; add unit test for application + nonce bump
…ests (unit-only; package requires FFI to run full tests)
…sages; add isolated policy helper + tests
…hen build tag enabled
…s completed; note scaffolded ApplyDelegations core
…pt, trampoline, EXTCODE* semantics, and event ABI encoding
…zation; adjust next steps to focus on ref-fvm tests + legacy removal
… skeletons; clarify Implementation notes
… event ABI; trivial fmt diffs
…topic/data (authority) confirmed; tests to follow
… update AGENTS Quick Validation
…flict by centralizing ParseEthRevert in chain/types/ethtypes and updating tests
…avoid OpenCL; plan targeted tests if needed
…ove single-EVM-actor references; mark EVM ApplyAndCall/InvokeAsEoa removed; update next steps and test plans
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the PR title to match https://github.com/filecoin-project/lotus/blob/master/CONTRIBUTING.md#pr-title-conventions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements EIP-7702 ("Set Code for EOAs") support in Lotus, enabling Ethereum-style delegated execution for Externally Owned Accounts (EOAs) on the Filecoin network. The implementation routes type-0x04 transactions to an EthAccount actor's ApplyAndCall entrypoint, with delegation semantics handled via VM intercept in ref-fvm.
Key Changes:
- Added RLP decoding/encoding for type-0x04 transactions with authorization tuples and per-type element limits
- Implemented routing to EthAccount.ApplyAndCall with canonical CBOR parameter encoding
- Extended receipts to surface authorizationList and delegatedTo fields for attribution
Reviewed Changes
Copilot reviewed 68 out of 70 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
chain/types/ethtypes/rlp.go |
Added per-type RLP element limits for 0x04 (13 elements vs 12 for EIP-1559) |
chain/types/ethtypes/eth_types.go |
Extended EthTxReceipt with authorizationList and delegatedTo fields |
chain/types/ethtypes/eth_transactions.go |
Added 0x04 transaction parsing, CBOR decoding for ApplyAndCall params, and routing logic |
node/impl/eth/utils.go |
Added embedded status decoding from ApplyAndCall return for receipts |
node/impl/eth/receipt_7702_scaffold.go |
Implemented receipt adjustment for delegated execution attribution |
node/impl/eth/gas_7702_scaffold.go |
Added behavioral gas overhead computation for authorization tuples |
node/impl/eth/gas.go |
Integrated 7702 intrinsic overhead into gas estimation |
| Test files | Comprehensive test coverage for RLP parsing, receipts, gas estimation, and E2E flows |
| Documentation | OpenRPC updates and migration plan documentation |
Comments suppressed due to low confidence (2)
node/impl/eth/utils.go:1
- Use the named constant
EIP7702TxTypeinstead of the magic number0x04for consistency with the rest of the codebase and improved maintainability.
itests/kit/node_unmanaged.go:1 - This change appears unrelated to EIP-7702. If this is addressing a separate CI flakiness issue, it should be in a separate commit or PR to maintain atomic changes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PR title now matches the required format.
Related Issues
Related FIP PR Link: filecoin-project/FIPs#1209
Related builtin actors PR link: filecoin-project/builtin-actors#1705
Proposed Changes
chain/types/ethtypes:authorizationList(6-field tuples).yParityvalidation (0/1 only).AuthorizationPreimageandAuthorizationKeccakimplementingkeccak256(0x05 || rlp([chain_id,address,nonce])).[ [tuple...], [to(20), value, input] ].chain_id/nonceup touint64; reject non‑canonical encodings.Eth7702TxArgs.ToUnsignedFilecoinMessageAtomicbuilds a Filecoin message targetingEthAccount.ApplyAndCall(FRC-42 method hash) with canonical CBOR params.-tags eip7702_enabled; addsEip7702FeatureEnabledflag and anEthAccountApplyAndCallActorAddractor address stub used by tests (the olderEvmApplyAndCallActorAddrremains as a deprecated alias for historical compatibility).adjustReceiptForDelegationsurfacesdelegatedTofromauthorizationListand, if absent, from a synthetic event topic emitted by the EVM/VM runtime.keccak("Delegated(address)"); data is a 32‑byte ABI word whose last 20 bytes form the authority (EOA) address.ApplyAndCallis targeted andauthorizationListis non‑empty.authorizationListanddelegatedTowhen present.yParity, per‑type list limit, canonical encoding, and overflow boundaries.AuthorizationKeccakvectors for stability.itests/Eth7702exercising send-path routing toEthAccount.ApplyAndCall, receipt fields (authorizationList/delegatedTo), and delegated CALL→EOA execution once the wasmbundle includes
EthAccount.ApplyAndCall+ VM intercept.Additional Info
eip7702_enabled; actor bundle controls consensus activation. No runtime NV gates in Lotus.Delegated(address)in final form for synthetic delegated attribution (seeadjustReceiptForDelegationand ref‑fvm intercept tests).go test ./chain/types/ethtypes -run 7702 -count=1go test ./node/impl/eth -run 7702 -count=1go test ./itests -run Eth7702 -tags eip7702_enabled -count=1Checklist
Before you mark the PR ready for review, please make sure that:
management)